﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.ServiceModel.Channels;
using System.Xml;

namespace Architecture.WCF.Tools
{
    public class PipelineDiagnostic : MessageHeader
    {
        public const String HeaderName="PipelineDiagnostic";
        public const String HeaderNamespace = "http://PipelineDiagnostic";

        public override string Name
        {
            get
            {
                return PipelineDiagnostic.HeaderName;
            }
        }

        public override string Namespace
        {
            get
            {
                return PipelineDiagnostic.HeaderNamespace;
            }
        }

        protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
        {
            writer.WriteElementString("Operation", this.Operation);
            writer.WriteElementString("OperationDuration", this.OperationDuration.ToString());
        }

        public String Operation { get; set; }
        public long OperationDuration { get; set; }

    }
}
